
import java.io.*;
import java.nio.ByteBuffer;
import java.util.List;

public class FileUtil {

    private FileUtil() {
        // Prevent instantiation
    }

    public static List<ByteBuffer> readLargeFile(String filePath) throws IOException {
        return StreamUtil.readLargeFile(new FileInputStream(filePath));
    }
    public static ByteBuffer readAsByteBuffer(String filePath) throws IOException {
        return StreamUtil.readAsByteBuffer(new FileInputStream(filePath));
    }
    public static ByteBuffer readAsMappedByteBuffer(String filePath) throws IOException {
        return StreamUtil.readAsMappedByteBuffer(new FileInputStream(filePath));
    }

    public static String readAsString(File file) throws IOException {
        InputStream inputStream = new FileInputStream(file);
        return StreamUtil.readAsString(inputStream);
    }
    public static String readAsString(String filePath) throws IOException {
        return FileUtil.readAsString(new File(filePath));
    }


    public static void writeStringToFile(File file, String content) throws IOException {
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
            writer.write(content);
        }
    }
    public static void writeStringToFile(String filePath, String content) throws IOException {
        FileUtil.writeStringToFile(new File(filePath), content);
    }
}


